package pl.com.like.sequoia.web.beans.view;

import java.io.Serializable;
import java.util.List;

import pl.com.like.sequoia.model.bio.BioObjectAlign;
import pl.com.like.sequoia.model.bio.BioObjectHandler;
import pl.com.like.sequoia.web.beans.search.AbstractObjectBean;
import pl.com.like.sequoia.web.vo.PdbObjectDataHandler;

public class ViewObjectBean extends AbstractObjectBean implements Serializable {

	private static final long serialVersionUID = 1092554950955018708L;
	private String objectName;
	private PdbObjectDataHandler obj;
	private List<BioObjectAlign> alignList;

	public List<BioObjectAlign> getAlignList() {
		String tempObj = getObjectName();
		if (tempObj != null && !tempObj.isEmpty()) {
			alignList = getObjectAligns(tempObj);
		}
		return alignList;
	}

	public PdbObjectDataHandler getObj() {
		String tempObj = getObjectName();
		if (tempObj != null && !tempObj.isEmpty()) {
			BioObjectHandler pdbobj = getObject(tempObj);
			alignList = getObjectAligns(tempObj);
			obj = new PdbObjectDataHandler(pdbobj);
		} else {
			obj = new PdbObjectDataHandler(new BioObjectHandler());
		}
		return obj;
	}

	public String getObjectName() {
		return objectName;
	}

	public void setAlignList(List<BioObjectAlign> alignList) {
		this.alignList = alignList;
	}

	public void setObj(PdbObjectDataHandler obj) {
		this.obj = obj;
	}

	public void setObjectName(String objectName) {
		this.objectName = objectName;
	}

}
